package pe.gob.sunarp.entidad;

import java.io.Serializable;
import javax.persistence.*;

/**
 * The primary key class for the RPT_TOMOFOLIO database table.
 * 
 */
@Embeddable
public class RptTomofolioPK implements Serializable {
	//default serial version id, required for serializable classes.
	private static final long serialVersionUID = 1L;
	private String regPubId;
	private String oficRegId;
	private String areaRegId;
	private String numPartida;
	private String nuTomo;
	private String nuFolio;
	private long nsCade;

    public RptTomofolioPK() {
    }

	@Column(name="REG_PUB_ID", unique=true, nullable=false, length=2)
	public String getRegPubId() {
		return this.regPubId;
	}
	public void setRegPubId(String regPubId) {
		this.regPubId = regPubId;
	}

	@Column(name="OFIC_REG_ID", unique=true, nullable=false, length=2)
	public String getOficRegId() {
		return this.oficRegId;
	}
	public void setOficRegId(String oficRegId) {
		this.oficRegId = oficRegId;
	}

	@Column(name="AREA_REG_ID", unique=true, nullable=false, length=5)
	public String getAreaRegId() {
		return this.areaRegId;
	}
	public void setAreaRegId(String areaRegId) {
		this.areaRegId = areaRegId;
	}

	@Column(name="NUM_PARTIDA", unique=true, nullable=false, length=8)
	public String getNumPartida() {
		return this.numPartida;
	}
	public void setNumPartida(String numPartida) {
		this.numPartida = numPartida;
	}

	@Column(name="NU_TOMO", unique=true, nullable=false, length=6)
	public String getNuTomo() {
		return this.nuTomo;
	}
	public void setNuTomo(String nuTomo) {
		this.nuTomo = nuTomo;
	}

	@Column(name="NU_FOLIO", unique=true, nullable=false, length=6)
	public String getNuFolio() {
		return this.nuFolio;
	}
	public void setNuFolio(String nuFolio) {
		this.nuFolio = nuFolio;
	}

	@Column(name="NS_CADE", unique=true, nullable=false, precision=4)
	public long getNsCade() {
		return this.nsCade;
	}
	public void setNsCade(long nsCade) {
		this.nsCade = nsCade;
	}

	public boolean equals(Object other) {
		if (this == other) {
			return true;
		}
		if (!(other instanceof RptTomofolioPK)) {
			return false;
		}
		RptTomofolioPK castOther = (RptTomofolioPK)other;
		return 
			this.regPubId.equals(castOther.regPubId)
			&& this.oficRegId.equals(castOther.oficRegId)
			&& this.areaRegId.equals(castOther.areaRegId)
			&& this.numPartida.equals(castOther.numPartida)
			&& this.nuTomo.equals(castOther.nuTomo)
			&& this.nuFolio.equals(castOther.nuFolio)
			&& (this.nsCade == castOther.nsCade);

    }
    
	public int hashCode() {
		final int prime = 31;
		int hash = 17;
		hash = hash * prime + this.regPubId.hashCode();
		hash = hash * prime + this.oficRegId.hashCode();
		hash = hash * prime + this.areaRegId.hashCode();
		hash = hash * prime + this.numPartida.hashCode();
		hash = hash * prime + this.nuTomo.hashCode();
		hash = hash * prime + this.nuFolio.hashCode();
		hash = hash * prime + ((int) (this.nsCade ^ (this.nsCade >>> 32)));
		
		return hash;
    }
}